<?php
namespace app\modules\admin\forms\goods;

use app\common\forms\BaseForm;

class GoodsAttributeForm extends BaseForm {

    public $goods_attr_id;
    public $goods_id;
    public $attr_id;
    public $attr_value;
    public $attr_price;
    public $count;

    public function rules()
    {
        return [
            ['goods_id','required','message'=>\Yii::t("app","商品ID不能为空")],
            ['attr_id','required','message'=>\Yii::t("app","属性ID不能为空")],
            ['attr_value','required','message'=>\Yii::t("app","属性值不能为空")],
            ['attr_price','double','skipOnEmpty'=>false,'message'=>\Yii::t("app","属性价格错误")],
            ['count','integer','integerOnly'=>true,'skipOnEmpty'=>false,'message'=>\Yii::t("app","商品库存错误")],
            ['goods_attr_id','safe']
        ];
    }
}